﻿<UserControl
    x:Class="DvachBrowser3.Views.Partial.PreviewImage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:DvachBrowser3.Views.Partial"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:dvachBrowser3="using:DvachBrowser3"
    mc:Ignorable="d"
    d:DesignHeight="75"
    d:DesignWidth="75">
    <UserControl.Resources>
        <dvachBrowser3:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
    </UserControl.Resources>
    
    <Grid>
        <Border x:Name="Loading" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" Height="{x:Bind ImageHeight, Mode=OneWay}" Width="{x:Bind ImageWidth, Mode=OneWay}" Visibility="{x:Bind IsLoadingVisible, Mode=OneWay}">
            <ProgressRing x:Name="LoadingRing" Height="48" Width="48" IsActive="True" Visibility="{x:Bind IsLoadingRingVisible, Mode=OneWay}" />
        </Border>
        <Image x:Name="MainImage" Height="{x:Bind ImageHeight, Mode=OneWay}" Width="{x:Bind ImageWidth, Mode=OneWay}" Visibility="{x:Bind IsImageVisible, Mode=OneWay}" Source="{x:Bind ImageData, Mode=OneWay}" Stretch="Fill" />
        <Border x:Name="ErrorSymbol" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}" Height="{x:Bind ImageHeight, Mode=OneWay}" Width="{x:Bind ImageWidth, Mode=OneWay}" Visibility="{x:Bind IsErrorVisible, Mode=OneWay}" Tapped="ErrorSymbol_OnTapped">
            <SymbolIcon Symbol="Clear" Foreground="Red" Height="48" Width="48" />
        </Border>
    </Grid>
</UserControl>
